<!DOCTYPE html>
<html lang='zh-CN'>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
  <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
  <title>查看会员优惠券</title>
  <link href="css/bootstrap.min.css" rel="stylesheet">
  <link href="css/materialdesignicons.min.css" rel="stylesheet">
  <link href="css/animate.css" rel="stylesheet">
  <link href="css/style.min.css" rel="stylesheet">
  <link href="js/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
</head>
<body>
<div class="container-fluid p-t-15">
  <div class="row">
    <div class="col-lg-12">
      <div class="card">
        <div class="card-header">
          <div id="toolbar" class="toolbar-btn-action">
            <form class="form-inline" method="post" id="searchForm">

            </form>
          </div>
        </div>
        <div class="card-body">
          <table id="grid_data" class="table text-nowrap"></table>
        </div>
      </div>
    </div>
  </div>
</div>

<#include "/footer.html"/>

<script type="text/javascript">

  //设置表头
  var columnes = [
    {checkbox: true},
    {field: 'memberId',title: '会员ID'},
    {field: 'couponName',title: '优惠劵名称'},
    {field: 'couponType', title: '优惠劵类型',formatter: function (value, row){
        if (value==1){ return "满减券"
        }else if (value==2){ return "商品卷"
        }else if (value==3){ return "赠送卷"
        }else if (value==4){ return "新人劵"
        }else if (value==5){ return "通用券" }}},
    {field: 'isUsed', title: '优惠券状态',formatter: function (value, row){ return value == 0 ? "未使用" : value == 1 ? "已使用" : "已过期"}},
    {field: 'faceValue',title: '优惠劵面值'},
    {field: 'faceValueDemand',title: '面值条件'},
    {field: 'startTime',title: '开始时间',formatter: function (value) { return zero2one.dateFormat(value, 'Y-m-d H:i:s') }},
    {field: 'endTime',title: '结束时间',formatter: function (value) { return zero2one.dateFormat(value, 'Y-m-d H:i:s') }}
  ];

  zero2one.datagrid("grid_data", "/remote/member/coupon/list",function (params) {
    return $.extend(zero2one.tableInitParam(params), {memberId: zero2one.getUrlParam('memberId')});
  }, columnes);

</script>
</body>
</html>
